package com.yztc.ui.classify;

import android.content.Context;

import com.yztc.bean.classify.ClassifyBean;
import com.yztc.ui.classify.config.ClassifyUrlConfig;

/**
 * Created by MengLingzhang on 2016/10/6.
 */
public class ClassifyPresenter implements ClassifyContract.Presenter{
    private ClassifyContract.View view;
    private ClassifyModle modle;

    public ClassifyPresenter(ClassifyContract.View view){
        this.view=view;
        this.modle=new ClassifyModle();
    }

    @Override
    public void getVerticalClassifyDataBean(Context context) {
        modle.getVerticalClassifyBean(ClassifyUrlConfig.Path.BASE_URL, new ClassifyContract.OnLoadListener() {
            @Override
            public void onSuccess(ClassifyBean classifyBean) {
                view.ongetVerticalClassifyDataBean(classifyBean.getClassifyDataBean());
            }

            @Override
            public void onFailure(Throwable e) {
                view.onGetVerticalFailed(e);
            }
        });
    }
}
